#include "stdio.h"
#include "string.h"

double shu[10005]={0};
double pm[10005]={0};
double pn[10005]={0};

int m,n,k;

int main()
{
    int i,j,a;
    double tot;
    scanf("%d%d%d",&m,&n,&k);
    for (i=1;i<=k;i++)
        scanf("%lf",&shu[i]);
    tot=0;
    for (i=1;i<=m;i++) tot+=shu[i];
    i=1;
    j=i+m-1;
    pm[j]=tot/m;
    for (a=j+1;a<=k;a++)
    {
        tot-=shu[i];
        tot+=shu[a];
        i++;
        pm[a]=tot/m;
    }
    
    tot=0;
    for (i=1;i<=n;i++) tot+=shu[i];
    i=1;
    j=i+n-1;
    pn[j]=tot/n;
    for (a=j+1;a<=k;a++)
    {
        tot-=shu[i];
        tot+=shu[a];
        i++;        
        pn[a]=tot/n;
    }    
    
    i=n;
    if (pm[i]>pn[i])   printf("BUY ON DAY %d\n",i);
    else               printf("SELL ON DAY %d\n",i);
    i++;
    while (i<=k)
    {
        if (pm[i-1]<pn[i-1]&&pm[i]>pn[i])  printf("BUY ON DAY %d\n",i);
        if (pm[i-1]>pn[i-1]&&pm[i]<pn[i])  printf("SELL ON DAY %d\n",i);          
        i++;
    }    
//    scanf("%d",&i);
    return 0;
 
}    